import { useRoute } from "@react-navigation/native";
import PrivacyArgument from "@/components/Login/Argument/PrivacyArgument";
import UserArgument from "@/components/Login/Argument/UserAgrument";
import React from "react";

// 协议类型
export enum ArgumentType {
  PRIVACY = 0,
  USER = 1,
}

// 路由参数类型
interface ArgumentPageRouteProps {
  type: ArgumentType;
}

export default function ArgumentPage() {
  const { type } = useRoute().params as ArgumentPageRouteProps;
  switch (Number(type)) {
    case ArgumentType.PRIVACY:
      return <PrivacyArgument />;
    case ArgumentType.USER:
      return <UserArgument />;
    default:
      throw new Error("Unknown argument type");
  }
}
